#!/usr/bin/env python
#coding:utf-8

import os
import cgi, cgitb
import htmlheader

cgitb.enable()

rowNumber = 0
backgroundColor = "white"

htmlheader.htmlheader("Environment Variables")
print '''<table style="border: 0">'''
for item in os.environ.keys():
    rowNumber += 1

    if rowNumber % 2 == 0:
        backgroundColor = "white"
    else:
        backgroundColor = "lightgrey"

    print '''<tr style="background-color: %s">
    <td>%s</td>
    <td>%s</td>''' % (backgroundColor, cgi.escape(item), cgi.escape(os.environ[item]))

htmlheader.htmlend()
